home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / intrvews / xgrab.lha / xgrab / include / fonthandler.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-06  |  1.2 KB  |  48 lines

  1. /**
  2.    GRAB Graph Layout and Browser System
  3.  
  4.    Copyright (c) 1989, Tera Computer Company
  5.  **/
  6.  
  7.   /* header for handling fonts */
  8.  
  9. #ifndef fonthandler_h
  10. #define fonthandler_h
  11.  
  12. #include <InterViews/font.h>
  13. #include <InterViews/Graphic/ppaint.h>
  14.  
  15. static const numberfonts = 6;
  16. static const startfont = 4;
  17.  
  18. class FontHandler 
  19. {
  20. private:
  21.     Font *FontArray[numberfonts];
  22.     Font *psfont;            // font for postscript output 
  23.     int EdgeLabelMapArray[numberfonts]; 
  24.        // maps the current node font to the current edge font 
  25.     void set_fonts(int);
  26. public:
  27.     FontHandler();
  28.     void set_font(int, int);
  29.     void force_nlabel();
  30.     void noforce_nlabel();
  31.     void force_elabel();
  32.     void noforce_elabel();
  33.     void SmallestFont(int*, int*);
  34.     boolean FontWillFit(int, int);
  35.     void SetPS(char*);        // set the psfont
  36.     int WidthPS(char*);        // find the width of a string in the psfont
  37.  
  38.     Font* text_font;        // font for text messages
  39.     Font* node_font;        // font for node labels
  40.     Font* edge_font;        // font for edge labels
  41.     void newScreen();
  42.     boolean text_flag;        // will text fit in the nodes?
  43.     boolean nlabel_forced;    // if true, print node labels no matter what
  44.     boolean elabel_forced;    // if true, print edge labels
  45. };
  46.  
  47. #endif
  48.